dojo.provide("medryx.util.StringUtils");
dojo.require("dojox.encoding.base64");
(function() {
    var util = medryx.util.StringUtils;
	util.UrlDecode = function(psEncodeString) {
		
		var lsRegExp = /\+/g;
	  // Return the decoded string
	  return unescape(String(psEncodeString).replace(lsRegExp, " ")); 
	};
	
    util.capFirst = function(value){
		if (value === null) {
			return null;
		}
        // summary: Capitalizes the first character of the value
        value = "" + value;
        return value.charAt(0).toUpperCase() + value.substring(1);
    };
    
 
    util.decodeBase64 = function(str){
        var b = dojox.encoding.base64.decode(str);
		 var s = [];
        dojo.forEach(b, function(c){ s.push(String.fromCharCode(c)); });
        return s.join("");
    };
})();
